var app = getApp()
var QQMapWX = require('../../utils/qqmap-wx-jssdk.js');
Page({
  data: {
    objarr: [],
    height:0,
    width:0,
    ismine:false,
    userInfo: {},
    info:{},
    wishid:'',
    support:[]
  },
  onShareAppMessage: function (res) {
    let member_id = app.globalData.userInfo.member_id
    return {
      title: '心愿祈祷',
      path: '/pages/wish/yourwish?inviter_id=' + member_id,
      success: function (res) {
        // 转发成功
      },
      fail: function (res) {
        // 转发失败
      }
    }
  },
  onLoad: function (options) {
    var that = this;
    
    wx.getSystemInfo({
      success: function (res) {
        console.log(res);
        that.setData({
           width: res.windowWidth,
           height:res.windowHeight,
           userInfo: app.globalData.userInfo })
      }
    })
    console.log(options.from)
    if(options.from == 'mine'){
      this.setData({
        ismine:true
      })
    }else{
      this.setData({
        ismine:false
      })
    }
    if (!app.check_empty(options.scene)){
      app.ajax("wish_detail", { id: options.scene}, (data, err) => {
        if(data.data.info){
          this.setData({
            info:data.data.info,
            wishid: options.scene,
            support: data.data.support_list
          })
        }
        
      })
    }
    
  },
  tomoney(){
    wx.navigateTo({
      url: '/pages/money/select?id='+this.data.wishid,
    })
  },
  tosharesave(){
    wx.navigateTo({
      url: '/pages/wish/sharewish?id='+this.data.wishid,
    })
  },
 
 
  imageLoad(e) {
    let that = this
    this.setData({
      imgh: app.fixImgW(e, that.data.width),
    })
  },
  
 
  
});